'''
Created on 2011-11-2

@author: 123kangta
'''
import unittest
from core.filter.ioFilter import FilterChain
from core.filter.message import HandleMessageFilter
from core.filter.method import ExecutedMethodFilter

class FilterTest(unittest.TestCase):
    def test_init_filter(self):
        filters = (
            "core.filter.message.HandleMessageFilter",
            "core.filter.method.ExecutedMethodFilter"
            )
        chain = FilterChain()
        chain.init_filter(filters)

        first = chain.first_filter
        self.assertIsInstance(first, HandleMessageFilter)
        self.assertIsInstance(first.next, ExecutedMethodFilter)
        self.assertIsInstance(first.next.prev, HandleMessageFilter)
        
        
